package com.byedu.entity;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by Luo on 2017-05-20.
 */
public class PayBean {

    public PayBean() {
        this.time_create = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date(System.currentTimeMillis()));
        this.setSuccess(false);
    }

    public PayBean(WechatNotifyBean my) {

        this.setAppid(my.getAppid());
        this.setCourse_id(my.getAttach());
        this.setSuccess(true);
        this.setMch_id(my.getMch_id());
        this.setSub_mch_id(my.getSub_mch_id());
        this.setOpenid(my.getOpenid());
        this.setOut_trade_no(my.getOut_trade_no());
        this.setTime_end(my.getTime_end());
        this.setTotal_fee(my.getTotal_fee());
        this.setSign(my.getSign());
        this.setTransaction_id(my.getTransaction_id());
    }

    /**
     * 订单id，唯一标识
     */
    private String out_trade_no;
    /**
     * 账号id
     */
    private String mch_id;
    /**
     * 子账号id
     */
    private String sub_mch_id;
    /**
     * 微信公众号id
     */
    private String appid;
    /**
     * 用户openid
     */
    private String openid;
    /**
     * 付费金额
     */
    private String total_fee;
    /**
     * 是否成功
     */
    private boolean success;
    /**
     * 支付完成时间yyyyMMddHHmmss
     */
    private String time_end;
    /**
     * 支付创建时间yyyyMMddHHmmss
     */
    private String time_create;
    /**
     * 支付课程ID
     */
    private String course_id;

    public String getTransaction_id() {
        return transaction_id;
    }

    public void setTransaction_id(String transaction_id) {
        this.transaction_id = transaction_id;
    }

    /**
     * 微信的订单号
     */
    private String transaction_id;

    private String sign;

    @Override
    public String toString() {
        return "PayBean{" +
         "out_trade_no='" + out_trade_no + '\'' +
         ", mch_id='" + mch_id + '\'' +
         ", sub_mch_id='" + sub_mch_id + '\'' +
         ", appid='" + appid + '\'' +
         ", openid='" + openid + '\'' +
         ", total_fee='" + total_fee + '\'' +
         ", success=" + success +
         ", time_end='" + time_end + '\'' +
         ", time_create='" + time_create + '\'' +
         ", course_id='" + course_id + '\'' +
         ", sign='" + sign + '\'' +
         '}';
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public String getOut_trade_no() {
        return out_trade_no;
    }

    public void setOut_trade_no(String out_trade_no) {
        this.out_trade_no = out_trade_no;
    }

    public String getMch_id() {
        return mch_id;
    }

    public void setMch_id(String mch_id) {
        this.mch_id = mch_id;
    }

    public String getSub_mch_id() {
        return sub_mch_id;
    }

    public void setSub_mch_id(String sub_mch_id) {
        this.sub_mch_id = sub_mch_id;
    }

    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public String getTotal_fee() {
        return total_fee;
    }

    public void setTotal_fee(String total_fee) {
        this.total_fee = total_fee;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getTime_end() {
        return time_end;
    }

    public void setTime_end(String time_end) {
        this.time_end = time_end;
    }

    public String getTime_create() {
        return time_create;
    }

    public String getCourse_id() {
        return course_id;
    }

    public void setCourse_id(String course_id) {
        this.course_id = course_id;
    }
}
